home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH11 / 11-2-6.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-09-18  |  2.1 KB  |  73 lines

  1. VERSION 5.00
  2. Begin VB.Form frmWatch 
  3.    Caption         =   "Stopwatch"
  4.    ClientHeight    =   2550
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   2025
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   2550
  20.    ScaleWidth      =   2025
  21.    Begin VB.CommandButton cmdStop 
  22.       Caption         =   "Stop"
  23.       Height          =   495
  24.       Left            =   360
  25.       TabIndex        =   1
  26.       Top             =   1440
  27.       Width           =   1215
  28.    End
  29.    Begin VB.CommandButton cmdStart 
  30.       Caption         =   "Start"
  31.       Height          =   495
  32.       Left            =   360
  33.       TabIndex        =   0
  34.       Top             =   240
  35.       Width           =   1215
  36.    End
  37.    Begin VB.Timer tmrWatch 
  38.       Enabled         =   0   'False
  39.       Interval        =   100
  40.       Left            =   600
  41.       Top             =   2040
  42.    End
  43.    Begin VB.Label lblTime 
  44.       Height          =   375
  45.       Left            =   1080
  46.       TabIndex        =   3
  47.       Top             =   960
  48.       Width           =   615
  49.    End
  50.    Begin VB.Label lblSeconds 
  51.       Caption         =   "Seconds"
  52.       Height          =   255
  53.       Left            =   120
  54.       TabIndex        =   2
  55.       Top             =   960
  56.       Width           =   735
  57.    End
  58. Attribute VB_Name = "frmWatch"
  59. Attribute VB_GlobalNameSpace = False
  60. Attribute VB_Creatable = False
  61. Attribute VB_PredeclaredId = True
  62. Attribute VB_Exposed = False
  63. Private Sub cmdStart_Click()
  64.   lblTime.Caption = " 0"    'Reset watch
  65.   tmrWatch.Enabled = True
  66. End Sub
  67. Private Sub cmdStop_Click()
  68.   tmrWatch.Enabled = False
  69. End Sub
  70. Private Sub tmrWatch_Timer()
  71.   lblTime.Caption = Str(Val(lblTime.Caption) + 0.1)
  72. End Sub
  73.